import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '../components/HelloWorld'
import login from '../components/login'
import Layout from '../view/layout/index'
import hotel from  '../interview/hotel/hotel'
import index from '../interview/page'
Vue.use(Router);


export default new Router({
  routes: [
    {
      path: '/',
      name: 'HelloWorld',
      component: HelloWorld
    },
    {
      path: '/login',
      name: 'login',
      component: login
    },
    {
      path:'/layout',
      name:'Layout',
      component:()=>import('../view/layout/index')
    },
    {
      path:'/sys',
      component:Layout,
      children:[
        {
          path:'organ',
          component:()=>import('../view/system/organization')
        }
      ]
    },{
      path:'/sys',
      component:Layout,
      children:[
        {
          path:'dictionary',
          component:()=>import('../view/system/dictionary')
        }
      ]/*延迟加载  需要的时候进行加载*/
    },{
      path:'/sys',
      component:Layout,
      children:[
        {
          path:'employee',
          component:()=>import('../view/system/employee')
        }
      ]
    },
     {
      path:'/sys',
      component:Layout,
      children:[
        {
          path:'message',
          component:()=>import('../view/message/message')
        }
      ]
     },{
      path:'/sys',
      component:Layout,
      children:[
        {
          path:'user',
          component:()=>import('../view/system/user')
        }
      ]
    },{
       path:'/hotel',
       name:'hotel',
       component:hotel
    },{
       path:'/index',
       component:index,
       children:[
         {
           path:'hotel',
           component:hotel,
           children:[
             {
               path:'diving',
               component:()=>import('../interview/hotel/recommend/diving')
             },
             {
               path:'history',
               component:()=>import('../interview/hotel/recommend/history')
             },
             {
               path:'eating',
               component:()=>import('../interview/hotel/recommend/eating')
             },{
               path:'weekday',
               component:()=>import('../interview/hotel/recommend/weekday')
             },{
               path:'cheaptHotel',
               component:()=>import('../interview/hotel/recommend/cheaptHotel')
             },{
               path:'fairy',
               component:()=>import('../interview/hotel/recommend/fairyTown')
             }
           ]
         },{
           path:'index1',
           component:()=>import('../interview/index/index')
         }
       ],
    }
  ]
})
